#ifndef PARSER_H
#define PARSER_H
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include "grammar.h"
#include "item.h"
#include "features.h"

using namespace std;

class parser {

 protected:
  grammar Grammar;
  list <pair <string, class features*> > Sentence;
  vector <ITEMSET *> States;  
  unsigned int LastState;
  
 public:
  
  parser(grammar g, list<pair <string, class features*> > s){
  Grammar=g;
  Sentence=s;
};
  void print_grammar(ostream&);
  void print_sentence(ostream&);
  void print_states(ostream&);
  void print_last_state(ostream&);
  int parse_earley(); 
  void evaluate(string);
  
 private:
  bool shift(string, class features*);
  bool close(string);
  bool reduce(string);
};

#endif // PARSER_H

